//
//  SYMedicineDirectionCell.m
//  songyao
//
//  Created by work on 16/10/20.
//  Copyright © 2016年 saikuo. All rights reserved.
//

#import "SYMedicineDirectionCell.h"
#import "SYMedicineModel.h"


@implementation SYMedicineDirectionCell {
    UILabel *_directionLabel;
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        _directionLabel = [[UILabel alloc] init];
        _directionLabel.numberOfLines = 0;
        _directionLabel.textColor = [UIColor contentColor];
        _directionLabel.font = [UIFont textFieldInputFont];
        [self.contentView addSubview:_directionLabel];
        [_directionLabel makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(self.mas_left).offset(10);
            make.right.equalTo(self.mas_right).offset(-10);
            make.top.equalTo(self.mas_top).offset(5);
        }];
    }
    return self;
}

- (void)setData:(SYMedicineModel *)data {
    _data = data;
    _directionLabel.text = data.direction;
}

+ (CGSize)textSizeWithText:(NSString *)text {
    return [text boundingRectWithSize:CGSizeMake(SCREEN_WIDTH - 20, MAXFLOAT)
                              options:NSStringDrawingUsesLineFragmentOrigin
                           attributes:@{NSFontAttributeName:[UIFont textFieldInputFont]}
                              context:nil].size;
}

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
